<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>角色添加</title>
    <link href="${base}/resource/admin/css/common.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/jquery.validate.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/common.js"></script>
    <script type="text/javascript" src="${base}/resource/admin/js/input.js"></script>
    <style type="text/css">
        .authorities label {
            min-width: 120px;
            _width: 120px;
            display: block;
            float: left;
            padding-right: 4px;
            _white-space: nowrap;
        }
    </style>
    <script type="text/javascript">
        $().ready(function() {

            var $inputForm = $("#inputForm");
            var $selectAll = $("#inputForm .selectAll");

		[@flash_message /]

            $selectAll.click(function() {
                var $this = $(this);
                var $thisCheckbox = $this.closest("tr").find(":checkbox");
                if ($thisCheckbox.filter(":checked").size() > 0) {
                    $thisCheckbox.prop("checked", false);
                } else {
                    $thisCheckbox.prop("checked", true);
                }
                return false;
            });

            // 表单验证
            $inputForm.validate({
                rules: {
                    name: "required",
                    authorities: "required"
                }
            });

        });
    </script>
</head>
<body>
<div class="path">
    <a href="${base}/admin/main.do">首页</a> &raquo; 角色编辑
</div>
<form id="inputForm" action="save.do" method="post">
    <table class="input">
        <tr>
            <th>
                <span class="requiredField">*</span>角色名称:
            </th>
            <td>
                <input type="text" name="name" class="text" value="" maxlength="200" />
            </td>
        </tr>
        <tr>
            <th>
                备注:
            </th>
            <td>
                <input type="text" name="description" class="text" value="" maxlength="200" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                &nbsp;
            </td>
        </tr>
        <tr class="authorities">
            <th>
                <a href="javascript:;" class="selectAll" title="选择所有">其他</a>
            </th>
            <td>
				<span class="fieldSet">
						<label>
                            <input type="checkbox" name="authorities" value="admin:profile" />个人设置
                        </label>
						<label>
                            <input type="checkbox" name="authorities" value="admin:base" />后台访问
                        </label>
				</span>
            </td>
        </tr>
        <tr class="authorities">
            <th>
                <a href="javascript:;" class="selectAll" title="${message("admin.role.selectAll")}">系统</a>
            </th>
            <td>
					<span class="fieldSet">
						<label>
                            <input type="checkbox" name="authorities" value="admin:setting"/>系统设置
                        </label>
						<label>
                            <input type="checkbox" name="authorities" value="admin:role"/>角色
                        </label>
						<label>
                            <input type="checkbox" name="authorities" value="admin:operator" />管理员
                        </label>
						<label>
                            <input type="checkbox" name="authorities" value="admin:smsTemplate" />短信模板
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:area" />地区
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:storage_plugin" />存储插件
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:druid" />Druid监控
                        </label>
					</span>
            </td>
        </tr>
        <tr class="authorities">
            <th>
                <a href="javascript:;" class="selectAll" title="${message("admin.role.selectAll")}">业务管理</a>
            </th>
            <td>
					<span class="fieldSet">
						<label>
                            <input type="checkbox" name="authorities" value="admin:member" />用户管理
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:tradeRecord" />用户管理
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:ad_position"/>广告位
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:factory"/>[精选]厂商
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:article"/>资讯新闻
                        </label>
                           <label>
                               <input type="checkbox" name="authorities" value="admin:static"/>静态化
                           </label>
                          <label>
                              <input type="checkbox" name="authorities" value="admin:sms"/>SMS
                          </label>
					</span>
            </td>
        </tr>
        <tr class="authorities">
            <th>
                <a href="javascript:;" class="selectAll" title="${message("admin.role.selectAll")}">夺宝管理</a>
            </th>
            <td>
					<span class="fieldSet">
						<label>
                            <input type="checkbox" name="authorities" value="admin:dbProduct" />夺宝商品
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:dbOrder"/>夺宝订单
                        </label>
                        <label>
                            <input type="checkbox" name="authorities" value="admin:dbTimes"/>夺宝期数
                        </label>
					</span>
            </td>
        </tr>
        <tr>
            <th>
                &nbsp;
            </th>
            <td>
                <input type="submit" class="button" value="提交"/>
                <input type="button" class="button" value="返回" onclick="location.href='list.do'" />
            </td>
        </tr>
    </table>
</form>
</body>
</html>